const express = require('express')
const errorHandle =  require('./middleware/error-handle')
const { config } = require('./config')
const router = require('./routers')

const app = express()

app.use(express.json())
app.use(express.urlencoded({ extended: false }))

app.use('/api', router)


app.use(errorHandle())

app.listen(config.PORT, () => {
    console.log(`🚀 服务已启动，http://localhost:${config.PORT}`)
})